<h1>CONTRATOS PERTENECIENTES A <?php echo strtoupper($user_nombre); ?></h1>
<div>
    <table id="tabla"  width="100%">
        <thead>
            <tr>
                <th>Número</th>
                <th>Fecha de inicio</th>
                <th>Fecha finalización </th>            
                <th colspan = '4'></th>
            </tr>
        </thead>

        <tbody>
            <?php foreach ($contratos as $contrato): ?>
                <tr>
                    <td><?php echo $contrato['Contract']['numero'] ?></td>
                    <td><?php echo $contrato['Contract']['fecha_inicio'] ?></td>
                    <td><?php echo $contrato['Contract']['fecha_final'] ?></td>
                    <td><br><?php echo $this->Ajax->link('Ver', array('controller' => 'Contracts', 'action' => 'view', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions')) ?><br></td>
                    <td><br><?php echo $this->Ajax->link('Editar', array('controller' => 'Contracts', 'action' => 'edit', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading', 'complete' => 'cargar()', 'class' => 'actions')) ?><br></td>
                    <td><br><?php echo $this->Ajax->link('Obligaciones', array('controller' => 'Obligations', 'action' => 'index', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions')) ?><br></td>
                    <td><br><?php echo $this->Ajax->link('Cuentas de cobro', array('controller' => 'Accounts', 'action' => 'index', $contrato['Contract']['id']), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions')) ?><br></td>
                <?php endforeach; ?>
        </tbody>
    </table>
</div>
<p><?php echo $this->Ajax->link('Añadir contrato ' . $this->Html->image("add.png", array('width' => '30', 'heigth' => '30', 'alt' => 'Adicionar proyecto')), array('controller' => "Contracts", "action" => "add", $user_id), array('update' => 'content', 'indicator' => 'loading', 'escape' => false, 'complete' => 'cargar()')) ?></p>
